﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using NFine.Util;

namespace NFine.Web.Controllers
{
    public class NFineController : Controller
    {
        protected virtual JsonResult Success(string message)
        {
            return Json(new AjaxResult { state = ResultType.success.ToString(), message = message });
        }
        protected virtual JsonResult Success(string message, object data)
        {
            return Json(new AjaxResult { state = ResultType.success.ToString(), message = message, data = data });
        }
        protected virtual JsonResult Error(string message)
        {
            return Json(new AjaxResult { state = ResultType.error.ToString(), message = message });
        }
    }
}